<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateProductTable extends Migration {

	/**
	 * Run the migrations.
	 *
	 * @return void
	 */
	public function up()
	{
		//
		Schema::create('product', function($table){
			$table->bigIncrements('id');
			$table->string('name');
			$table->string('net', 30)->nullable();
			$table->bigInteger('type')->default(0)->unsigned();
			$table->bigInteger('brand')->default(0)->unsigned();
			$table->double('price', 20, 3)->default(0);
			$table->bigInteger('quantity');
			$table->timestamps();
			$table->softDeletes();

			$table->foreign('type')->references('id')->on('taxonomy');
			$table->foreign('brand')->references('id')->on('taxonomy');
		});
	}

	/**
	 * Reverse the migrations.
	 *
	 * @return void
	 */
	public function down()
	{
		//
	}

}
